﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NhanHoSoThuyetMinh.ascx.cs" Inherits="QuanLyDeTaiKHCN.UserControls.Manager.NhanHoSoThuyetMinh" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="udt1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <div class="control-group info row-fluid" >
            <fieldset style="width:100%;">
                <legend>Thông tin chung về đề tài</legend>
                <div style="float: left; width: 49%;">
                    <label class="control-label" style="padding-right: 10px;">Mã đề tài</label>
                    <div class="controls">
                        <asp:TextBox ID="txtMaDeTai" runat="server" ReadOnly="true" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Đề tài</label>
                    <div class="controls">
                        <fieldset class="span12" style="padding-left: 15px;">
                            <label class="radio inline">
                                <asp:RadioButton ID="rddetai" runat="server" GroupName="b" Checked="true" AutoPostBack="true" Text="Đề tài" />
                            </label>
                            <label class="radio inline">
                                <asp:RadioButton ID="rdduan" runat="server" GroupName="b" Text="Dự án" AutoPostBack="true" />
                            </label>
                        </fieldset>
                    </div>
                    <div style="height: 5px;clear:both;"></div>
                    <label class="control-label" style="padding-right: 10px;">Lĩnh vực</label>
                    <div class="controls">
                        <fieldset class="span12" style="padding-left: 15px;">
                            <label class="radio inline">
                                <asp:RadioButton ID="rdbtunhien" runat="server" GroupName="linhvuc" Checked="true" Text="Khoa học tự nhiên" />
                            </label>
                            <label class="radio inline">
                                <asp:RadioButton ID="rdbxahoi" runat="server" GroupName="linhvuc" Text="Khoa học xã hội"/>
                            </label>
                        </fieldset>
                    </div>
                    <div style="height:5px;clear:both;"></div>
                    <label class="control-label" style="padding-right: 10px;">Phương thức</label>
                    <div class="controls">
                        <fieldset class="span12" style="padding-left: 15px;">
                            <label class="radio inline">
                                <asp:RadioButton ID="rdnhanthuyetminh" runat="server" GroupName="a" Checked="true" Text="Giao trực tiếp" />
                            </label>
                            <label class="radio inline">
                                <asp:RadioButton ID="rdnhanhoso" runat="server"  GroupName="a" Text="Tuyển chọn"/>
                            </label>
                        </fieldset>
                    </div>
                    <div style="height: 5px;clear: both;"></div>
                    <label class="control-label" style="padding-right: 10px;">Năm ban hành danh mục</label>
                    <div class="controls">
                        <asp:TextBox ID="txtNamBanHanhDanhMuc" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    <div style="height:5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Tên đề tài</label>
                    <div class="controls">
                        <asp:TextBox ID="txtTenDeTai" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Thời gian thực hiện từ </label>
                    <div class="controls">
                        <asp:TextBox ID="txtThucHienTu" placeholder="Ngày/tháng/năm" runat="server" CssClass="span6" onblur="KiemTraInjection(this);"></asp:TextBox>
                        <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/CSS/images/lich.gif" AlternateText="Click để hiển thị ngày tháng năm" />
                        <ajaxToolkit:CalendarExtender ID="calendarButtonExtender2" runat="server" TargetControlID="txtThucHienTu" PopupButtonID="Image1" Format="dd/MM/yyyy" />
                        <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" MaskType="Date" runat="server" Mask="99/99/9999" TargetControlID="txtThucHienTu"></ajaxToolkit:MaskedEditExtender>
                        <asp:RequiredFieldValidator runat="server" ValidationGroup="kiemtra" ID="RequiredFieldValidator2" ControlToValidate="txtThucHienTu" Text="Nhập từ ngày" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Đến </label>
                    <div class="controls">
                        <asp:TextBox ID="txtThucHienDen" placeholder="Ngày/tháng/năm" runat="server" CssClass="span6" onblur="KiemTraInjection(this);"></asp:TextBox>
                        <asp:ImageButton runat="Server" ID="Image2" ImageUrl="~/CSS/images/lich.gif" AlternateText="Click để hiển thị ngày tháng năm" />
                        <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtThucHienDen" PopupButtonID="Image2" Format="dd/MM/yyyy" />
                        <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" MaskType="Date" runat="server" Mask="99/99/9999" TargetControlID="txtThucHienDen"></ajaxToolkit:MaskedEditExtender>
                        <asp:RequiredFieldValidator runat="server" ValidationGroup="kiemtra" ID="RequiredFieldValidator1" ControlToValidate="txtThucHienDen" Text="Nhập từ ngày" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Tổng kinh phí </label>
                    <div class="controls">
                        <asp:TextBox ID="txtTongKinhPhi" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="txtTongKinhPhi_FilteredTextBoxExtender" runat="server" FilterType="Numbers" TargetControlID="txtTongKinhPhi"></ajaxToolkit:FilteredTextBoxExtender>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" Display="Dynamic" ControlToValidate="txtTongKinhPhi" runat="server" Text="Nhập tổng kinh phí!" ForeColor="Red" ValidationGroup="kiemtra"></asp:RequiredFieldValidator>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Trong đó: </label>
                    <div style="height: 30px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Từ ngân sách sự  nghiệp khoa học </label>
                    <div class="controls">
                        <asp:TextBox ID="txtTuNganSach" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Numbers" TargetControlID="txtTuNganSach"></ajaxToolkit:FilteredTextBoxExtender>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" Display="Dynamic" ControlToValidate="txtTuNganSach" runat="server" Text="Nhập kinh phí từ ngân sách!" ForeColor="Red" ValidationGroup="kiemtra"></asp:RequiredFieldValidator>
                    </div>
                    <div style="height: 5px; clear: both;"></div>
                    <label class="control-label" style="padding-right: 10px;">Từ các nguồn vốn khác </label>
                    <div class="controls">
                        <asp:TextBox ID="txtNguonVonKhac" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Numbers" TargetControlID="txtNguonVonKhac"></ajaxToolkit:FilteredTextBoxExtender>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Thuộc chương trình (nếu có) </label>
                    <div class="controls">
                        <asp:TextBox ID="txtThuocChuongTrinh" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    
                </div>
                <div style="float: right; width: 49%;padding-right:5px;">
                    <label class="control-label" style="padding-right: 10px;">Chủ nhiệm đề tài/dự án: </label>
                    <div style="height: 30px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Họ và tên </label>
                    <div class="controls">
                        <asp:TextBox ID="txtHoTenChuNhiemDeTai" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" Display="Dynamic" ControlToValidate="txtHoTenChuNhiemDeTai" runat="server" Text="Nhập chủ nhiệm đề tài!" ForeColor="Red" ValidationGroup="kiemtra"></asp:RequiredFieldValidator>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Học hàm/học vị </label>
                    <div class="controls">
                        <asp:DropDownList ID="drlHocHamHocVi" runat="server" CssClass="span12 height" onblur="KiemTraInjection(this);"></asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rq3" InitialValue="-1" runat="server" Text="Chọn học hàm, học vị" ValidationGroup="kiemtra" Display="Dynamic" ForeColor="Red" SetFocusOnError="true" ControlToValidate="drlHocHamHocVi"></asp:RequiredFieldValidator>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Điện thoại nhà riêng</label>
                    <div class="controls">
                        <asp:TextBox ID="txtDienThoaiNhaRieng" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Điện thoại cơ quan </label>
                    <div class="controls">
                        <asp:TextBox ID="txtDienThoaiCoQuan" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Điện thoại di động </label>
                    <div class="controls">
                        <asp:TextBox ID="txtDienThoaiDiDong" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Địa chỉ email </label>
                    <div class="controls">
                        <asp:TextBox ID="txtEmail" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    
                    <div style="height: 5px; clear: both;"></div>

                    <label class="control-label" style="padding-right: 10px;">Đơn vị chủ trì thực hiện đề tài/dự án: </label>
                    <div style="height: 5px; clear: both;"></div>
                    <label class="control-label" style="padding-right: 10px;">Tên đơn vị </label>
                    <div class="controls">
                        <asp:TextBox ID="txtTenDonVi" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" Display="Dynamic" ControlToValidate="txtHoTenChuNhiemDeTai" runat="server" Text="Nhập đơn vị chủ trì đề tài!" ForeColor="Red" ValidationGroup="kiemtra"></asp:RequiredFieldValidator>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Địa chỉ</label>
                    <div class="controls">
                        <asp:TextBox ID="txtDiaChi" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Điện thoại </label>
                    <div class="controls">
                        <asp:TextBox ID="txtDienThoaiDonVi" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                    <div style="height: 5px;"></div>
                    <label class="control-label" style="padding-right: 10px;">Fax </label>
                    <div class="controls">
                        <asp:TextBox ID="txtFax" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                    </div>
                </div>
                <div style="clear:both;"></div>
                <div style="text-align:center;">
                    <asp:LinkButton ID="btnsave" Width="100" class="btn btn-primary" OnClick="btnsave_Click" ValidationGroup="kiemtra" runat="server"><i class=" icon-save"></i>&nbsp;&nbsp;Lưu</asp:LinkButton>
                    <asp:Label ID="lblstatus" runat="server" ForeColor="Red"></asp:Label>
                    <br />
                </div>
               
                <br />
            </fieldset>
            <br />
            <fieldset>
                <legend>Thời gian nhận thuyết minh</legend>
                <label class="control-label" style="padding-right: 10px;">File thuyết minh</label>
                <div class="controls">
                    <asp:FileUpload ID="filethuyetminhdetai" runat="server" />
                </div>
                <%--                    <div style="clear:both;height:5px;"></div>
                    <asp:Panel ID="p1" runat="server">
                        
                    </asp:Panel>--%>
                <div style="height: 5px; clear: both;"></div>
                <label class="control-label" style="padding-right: 10px;">Trích yếu</label>
                <div class="controls">
                    <asp:TextBox ID="txtghichufilethuyetminh" runat="server" TextMode="MultiLine" Height="50" CssClass="span11" onblur="KiemTraInjection(this);"></asp:TextBox>
                </div>
                <div style="height: 5px; clear: both"></div>
                <label class="control-label" style="padding-right: 10px;">Ngày nhận thuyết minh </label>
                <div class="controls">
                    <asp:TextBox ID="txtNgayNhanThuyetMinhDeCuong" placeholder="Ngày/tháng/năm" runat="server" CssClass="span2" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:ImageButton runat="Server" ID="ImageButton1" ImageUrl="~/CSS/images/lich.gif" AlternateText="Click để hiển thị ngày tháng năm" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtNgayNhanThuyetMinhDeCuong" PopupButtonID="ImageButton1" Format="dd/MM/yyyy" />
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender3" MaskType="Date" runat="server" Mask="99/99/9999" TargetControlID="txtNgayNhanThuyetMinhDeCuong"></ajaxToolkit:MaskedEditExtender>
                    <asp:RequiredFieldValidator runat="server" ValidationGroup="kiemtra1" ID="RequiredFieldValidator7" ControlToValidate="txtNgayNhanThuyetMinhDeCuong" Text="Nhập ngày nhận thuyết minh đề cương" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
                </div>
                <div style="height: 5px; clear: both"></div>
                <label class="control-lable" style="padding-right: 10px;"></label>
                <div class="controls">
                    <asp:LinkButton ID="LinkAddFile" OnClick="LinkAddFile_Click" ValidationGroup="kiemtra1" class="btn btn-primary" runat="server"><i class="icon-file-alt"></i>&nbsp;&nbsp;Thêm</asp:LinkButton>
                    <asp:Label ID="lblmessage" runat="server" ForeColor="Red"></asp:Label>
                </div>
                <%--danh sach file --%>

                <div style="height: 5px; clear: both;"></div>
                <asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" ForeColor="#333333" OnRowDeleting="grid_RowDeleting">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:TemplateField HeaderText="Trích yếu">
                            <ItemTemplate>
                                <%#Eval("TrichYeu") %>
                                <asp:Label ID="lblFileName" runat="server" Visible="false" Text='<%#Eval("FileThuyetMinh") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="ItemGridCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Ngày nhận thuyết minh">
                            <ItemTemplate>
                                <%#Eval("NgayLuu") %>
                            </ItemTemplate>
                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="true" HeaderText="Xóa">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" Text="<i class='icon-remove red'></i> Xóa"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="true" HeaderText="Xem">
                            <ItemTemplate>
                                <%--<a href='<%="./?mod="+_se.Encrypt("Xem_online_hoso","gold",128)+"&id="+Request.QueryString["id"]%>&linkonline=<%#Eval("Fileonline")%>' title="Chọn để xem nội dung"><i class='icon-folder-open-alt'></i>&nbsp;Xem</a>--%>
                                <a href='<%#QuanLyDeTaiKHCN.Obj_class.PageURL.local+"filehoso/"+Eval("FileThuyetMinh")%>'title="Chọn để xem nội dung"><i class='icon-folder-open-alt'></i>&nbsp;Xem</a>
                            </ItemTemplate>
                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>
                <div style="height: 5px; clear: both"></div>
            </fieldset>
        </div>
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="LinkAddFile" />
    </Triggers>
</asp:UpdatePanel>
